<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        window.onload = function () {
            var form = document.getElementsByTagName('form');
            var result = document.getElementsByTagName('div')[0];
            var inputs = document.getElementsByTagName('input');

            form.onsubmit = function () {
                return Year(inputs.year) && Month(inputs.month);
            };

            function Year(year) {
              if (!year.value.match(/  /)){

              }
            }
        }


    </script>
</head>
<body>
<form id="form">
    年度<input type="text" name="year"/>
    月份<input type="text" name="month"/>
    <input type="submit" value="查询"/>
</form>
<div id="result"></div>
</body>
</html>